<html>
<head>
<title>File Source for download.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPExcel</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              		  [ <a href="../classtrees_PHPExcel.html" class="menu">class tree: PHPExcel</a> ]
		  [ <a href="../elementindex_PHPExcel.html" class="menu">index: PHPExcel</a> ]
		  	    [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPExcel.html">PHPExcel</a><br />
              <a href="../li_com-tecnick-tcpdf.html">com-tecnick-tcpdf</a><br />
              <a href="../li_JAMA.html">JAMA</a><br />
              <a href="../li_Math_Stats.html">Math_Stats</a><br />
              <a href="../li_PHPExcel_CachedObjectStorage.html">PHPExcel_CachedObjectStorage</a><br />
              <a href="../li_PHPExcel_Calculation.html">PHPExcel_Calculation</a><br />
              <a href="../li_PHPExcel_Cell.html">PHPExcel_Cell</a><br />
              <a href="../li_PHPExcel_Chart.html">PHPExcel_Chart</a><br />
              <a href="../li_PHPExcel_Chart_Renderer.html">PHPExcel_Chart_Renderer</a><br />
              <a href="../li_PHPExcel_Reader.html">PHPExcel_Reader</a><br />
              <a href="../li_PHPExcel_Reader_Excel5.html">PHPExcel_Reader_Excel5</a><br />
              <a href="../li_PHPExcel_Reader_Excel2007.html">PHPExcel_Reader_Excel2007</a><br />
              <a href="../li_PHPExcel_RichText.html">PHPExcel_RichText</a><br />
              <a href="../li_PHPExcel_Settings.html">PHPExcel_Settings</a><br />
              <a href="../li_PHPExcel_Shared.html">PHPExcel_Shared</a><br />
              <a href="../li_PHPExcel_Shared_Escher.html">PHPExcel_Shared_Escher</a><br />
              <a href="../li_PHPExcel_Shared_OLE.html">PHPExcel_Shared_OLE</a><br />
              <a href="../li_PHPExcel_Shared_Trend.html">PHPExcel_Shared_Trend</a><br />
              <a href="../li_PHPExcel_Shared_ZipArchive.html">PHPExcel_Shared_ZipArchive</a><br />
              <a href="../li_PHPExcel_Style.html">PHPExcel_Style</a><br />
              <a href="../li_PHPExcel_Worksheet.html">PHPExcel_Worksheet</a><br />
              <a href="../li_PHPExcel_Worksheet_Drawing.html">PHPExcel_Worksheet_Drawing</a><br />
              <a href="../li_PHPExcel_Writer.html">PHPExcel_Writer</a><br />
              <a href="../li_PHPExcel_Writer_Excel5.html">PHPExcel_Writer_Excel5</a><br />
              <a href="../li_PHPExcel_Writer_Excel2007.html">PHPExcel_Writer_Excel2007</a><br />
            <br /><br />
                  
      
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file download.php</h1>
<p>Documentation is available at <a href="../PHPExcel/_PHPExcel---Shared---JAMA---docs---download.php.html">download.php</a></p>
<div class="src-code">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">*&nbsp;Script&nbsp;to&nbsp;create&nbsp;REGRESS&nbsp;package&nbsp;for&nbsp;download</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Mike&nbsp;Bommarito</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Paul&nbsp;Meagher</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;0.3</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-tag">@modified</span><span class="src-doc">&nbsp;Apr&nbsp;2,&nbsp;2006</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">*&nbsp;&nbsp;Note:&nbsp;Script&nbsp;requires&nbsp;the&nbsp;PEAR&nbsp;Archive_Tar&nbsp;package&nbsp;be&nbsp;installed:</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;http://pear.php.net/package/Archive_Tar</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-comm">//&nbsp;name&nbsp;and&nbsp;directory&nbsp;of&nbsp;package</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-var">$pkgName&nbsp;&nbsp;&nbsp;</span>=&nbsp;<span class="src-str">&quot;JAMA&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-comm">//&nbsp;root&nbsp;of&nbsp;PHP/Math&nbsp;build&nbsp;directory</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-var">$buildDir&nbsp;&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/dirname">dirname</a><span class="src-sym">(</span>__FILE__<span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span>-<span class="src-num">5&nbsp;</span>-&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$pkgName</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-comm">//&nbsp;switch&nbsp;to&nbsp;PHP/Math&nbsp;build&nbsp;directory</span></div></li>
<li><div class="src-line"><a name="a22"></a><a href="http://www.php.net/chdir">chdir</a><span class="src-sym">(</span><span class="src-var">$buildDir</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-var">$tarName&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>.tar.gz</span><span class="src-str">&quot;</span><span class="src-sym">;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-var">$tarPath&nbsp;</span>=&nbsp;<span class="src-var">$buildDir</span>.<span class="src-var">$pkgName</span>.<span class="src-str">&quot;/downloads/&quot;</span>.<span class="src-var">$tarName</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$_GET</span><span class="src-sym">[</span><span class="src-str">'op'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-str">&quot;download&quot;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'Archive/Tar.php'</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tar&nbsp;&nbsp;&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">Archive_Tar</span><span class="src-sym">(</span><span class="src-var">$tarPath</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;create&nbsp;$pkgName&nbsp;archive&nbsp;under&nbsp;$pkgName&nbsp;folder</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/*.php</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/*.TXT</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/docs/*.php</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/docs/includes/*.php</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/examples/*.php</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/tests/*.php</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;<span class="src-var">$files&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$pkgName</span>/utils/*.php</span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tar</span><span class="src-sym">-&gt;</span><span class="src-id">create</span><span class="src-sym">(</span><span class="src-var">$files</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;create&nbsp;the&nbsp;download&nbsp;url</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;<span class="src-var">$webDir&nbsp;&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span>-<span class="src-num">18</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;<span class="src-var">$urlPath&nbsp;</span>=&nbsp;<span class="src-str">&quot;http://&quot;</span>.<span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTP_HOST'</span><span class="src-sym">]</span>.<span class="src-var">$webDir</span>.<span class="src-str">&quot;/downloads&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;redirect&nbsp;to&nbsp;download&nbsp;url</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Location:&nbsp;<span class="src-var">$urlPath</span>/<span class="src-var">$tarName</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/header.php&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/navbar.php&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-php">?&gt;</span></div></li>
<li><div class="src-line"><a name="a57"></a>&lt;p&gt;</div></li>
<li><div class="src-line"><a name="a58"></a>Download&nbsp;current&nbsp;version:&nbsp;</div></li>
<li><div class="src-line"><a name="a59"></a>&lt;/p&gt;</div></li>
<li><div class="src-line"><a name="a60"></a>&lt;ul&gt;</div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&lt;li&gt;&lt;a&nbsp;href='<span class="src-php">&lt;?php&nbsp;</span>echo&nbsp;<span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span>.<span class="src-str">&quot;?op=download&quot;</span><span class="src-sym">;&nbsp;</span><span class="src-php">?&gt;</span>'&gt;<span class="src-php">&lt;?php&nbsp;</span>echo&nbsp;<span class="src-var">$tarName&nbsp;</span><span class="src-php">?&gt;</span>&lt;/a&gt;&lt;/li&gt;</div></li>
<li><div class="src-line"><a name="a62"></a>&lt;/ul&gt;</div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/footer.php&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-php">?&gt;</span></div></li>
</ol>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Sat, 19 May 2012 14:33:57 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>